package com.control.qct.businesssteward.activity;

import android.annotation.SuppressLint;
import android.graphics.Color;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

import com.control.qct.businesssteward.R;
import com.control.qct.businesssteward.base.BaseActivity;
import com.control.qct.businesssteward.base.BaseFragment;
import com.control.qct.businesssteward.fragment.ReplenishmentOrderDetailFragment;

import butterknife.BindView;
import butterknife.OnClick;

/**
 * 调货确认
 * Created by Administrator on 2018/1/17 0017.
 */

public class SubmitTheCargoActivity extends BaseActivity {
    @BindView(R.id.iv_submit_status)
    ImageView mIvSubmitStatus;
    @BindView(R.id.tv_submit_status)
    TextView mTvSubmitStatus;
    @BindView(R.id.tv_complete_or_resubmit)
    TextView mTvCompleteOrResubmit;
    @BindView(R.id.tv_examine_or_return)
    TextView mTvExamineOrReturn;

    private int mId;

    public SubmitTheCargoActivity() {
        super(R.layout.activity_submit_the_cargo);
    }

    @Override
    protected void getBundleExtras(Bundle extras) {
        super.getBundleExtras(extras);
        mId = extras.getInt("id");
    }

    @Override
    protected void initView() {
        setLeftIcon(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                finish();
            }
        });
        setTitle("调货");
        mIvSubmitStatus.setImageResource(mId == 1 ? R.mipmap.ic_launcher : R.drawable.icon_placeholder);
        mTvCompleteOrResubmit.setBackgroundResource(mId == 1 ? R.drawable.shape_red_5 : R.drawable.shape_green_5);
        mTvSubmitStatus.setTextColor(mId == 1 ? Color.parseColor("#FE4C6D") : Color.parseColor("#05C0AB"));
        mTvSubmitStatus.setText(mId == 1 ? "提交失败" : "提交成功");
        mTvCompleteOrResubmit.setText(mId == 1 ? "重新提交" : "完成");
        mTvExamineOrReturn.setText(mId == 1 ? "返回" : "查看调拨详情");

    }

    @OnClick({R.id.tv_complete_or_resubmit, R.id.tv_examine_or_return})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.tv_complete_or_resubmit://完成/重新提交
                break;
            case R.id.tv_examine_or_return://查看调拨详情/返回
                break;
        }
    }
}
